@extends('pc.v3.layouts.newapp')
@push('styles')
  <link rel="stylesheet" href="{{web_static('pc/v3/css/customer-service.min.css',true)}}"/>
  <link rel="stylesheet" href="{{web_static('pc/v3/kit/jquery.mloading/jquery.mloading.css',true)}}"/>
@endpush
@section('header')
@endsection
@section('content')
  <div class="index-back">
    <div class="cus-title"><span>租前客户</span><span>业主客户</span></div>
    <div class="cus-middle">
      <form id="zuke-form">
        <ul class="cus-ul-one">
          <li><span><i>*&nbsp;</i>称呼</span>
            <div class="cus-input-back">
              <input type="text" id="zuke_customer_name" name="zuke_customer_name" value="{{$customer->customer_name}}"/>
            </div>
          </li>
          <li><span><i>*&nbsp;</i>手机</span>
            <div class="cus-input-back">
              <input type="text" id="zuke_phone" name="zuke_phone" value="{{$customer->phone}}"/>
            </div>
          </li>
          <li><span><i>*&nbsp;</i>城市</span>
            <div class="cus-input-back">
              @if(!empty($customer->city_code))
                @php $customCityCode = $customer->city_code; @endphp
              @endif
              <select id="zuke_city_code" name="zuke_city_code" class="cus-input-are">
                @foreach ($cityItems as $item)
                  @if($customCityCode == $item->area_code)
                    <option value="{{$item->area_code}}" selected="selected">{{$item->name}}</option>
                  @else
                    <option value="{{$item->area_code}}">{{$item->name}}</option>
                  @endif
                @endforeach
              </select>
            </div>
          </li>
          <li><span><i>*&nbsp;</i>城区</span>
            <div class="cus-input-back">
              <select id="zuke_rent_area_code" name="zuke_rent_area_code" class="cus-input-are">
                <option>加载中</option>
              </select>
            </div>
          </li>
          <li><span><i>*&nbsp;</i>商圈</span>
            <div class="cus-input-back">
              <select id="zuke_rent_business_circle_ids" name="zuke_rent_business_circle_ids" class="cus-input-are">
                <option>加载中</option>
              </select>
            </div>
          </li>
          <li><span>来源</span>
            <div class="cus-input-back">
              <select id="zuke_customer_from" name="zuke_customer_from" @if(in_array($zukeSource,array_keys($zukeFormItems))){{'disabled'}}@endif="@if(in_array($zukeSource,array_keys($zukeFormItems))){{'disabled'}}@endif" class="cus-input-are">
                @foreach ($zukeFormItems as $key => $val)
                  @if($zukeSource == $key)
                    <option value="{{$key}}" selected="selected">{{$val}}</option>
                  @else
                    <option value="{{$key}}">{{$val}}</option>
                  @endif
                @endforeach
              </select>
              @if(in_array($zukeSource,array_keys($zukeFormItems)))
                <input type="hidden" name="zuke_customer_from" value="{{ $zukeSource }}"/>
              @endif
            </div>
          </li>
          <li><span>渠道</span>
            <div class="cus-input-back">
              <select id="zuke_customer_submit_channel" name="zuke_customer_submit_channel" class="cus-input-are">
                @foreach ($zukeSubmitChannelItems as $key => $val)
                  @if($zukeChannel == $key)
                    <option value="{{$key}}" selected="selected">{{$val}}</option>
                  @else
                    <option value="{{$key}}">{{$val}}</option>
                  @endif
                @endforeach
              </select>
            </div>
          </li>
          <li><span>户型</span>
            <div id="cus-input-backtwo" class="cus-input-back">
              <input type="text" id="zuke_rent_rooms" name="zuke_rent_rooms" value="{{$customer->rent_rooms}}"/>室
              <input type="text" id="zuke_rent_livings" name="zuke_rent_livings" value="{{$customer->rent_livings}}"/>厅
            </div>
          </li>
          <li><span>价格</span>
            <div id="cus-input-backtwos" class="cus-input-back">
              <input type="text" id="zuke_rent_from_price" name="zuke_rent_from_price" value="{{$customer->rent_from_price}}"/>-
              <input type="text" id="zuke_rent_to_price" name="zuke_rent_to_price" value="{{$customer->rent_to_price}}"/>元
            </div>
          </li>
          <li><span>入住时间</span>
            <div class="cus-input-back">
              <input type="date" id="zuke_rent_date" name="zuke_rent_date" value="{{$customer->rent_date}}"/>
            </div>
          </li>
          <li class="cus-input-backoth"><span>其它</span>
            <div class="cus-input-back">
              <textarea id="zuke_rent_other" name="zuke_rent_other" class="cus-input-text">{{$customer->rent_other}}</textarea>
            </div>
          </li>
          <li style="color:#cd0a0a" class="msg"></li>
          <li><a id="zuke-submit" class="cus-index-sub">提交</a><a href="javascript:;" id="zuke-reset">重置</a></li>
          <li>
            <input type="hidden" name="_token" value="{{ csrf_token() }}"/>
            <input type="hidden" name="zuke_online_customer_id" value="{{$qiyuUid}}"/>
          </li>
        </ul>
      </form>
      <form id="yezhu-form">
        <ul class="cus-ul-two">
          <li><span><i>*&nbsp;</i>称呼</span>
            <div class="cus-input-back">
              <input type="text" id="yezhu_contact" name="yezhu_contact" class="cus-input-tit"/>
            </div>
          </li>
          <li><span><i>*&nbsp;</i>手机</span>
            <div class="cus-input-back">
              <input type="text" id="yezhu_contact_tel" name="yezhu_contact_tel" value="{{$customPhoneCode}}" class="cus-input-mob"/>
            </div>
          </li>
          <li><span><i>*&nbsp;</i>城市</span>
            <div class="cus-input-back">
              <select id="yezhu_city_code" name="yezhu_city_code" class="cus-input-are">
                @foreach ($cityItems as $item)
                  @if($customCityCode == $item->area_code)
                    <option value="{{$item->area_code}}" selected="selected">{{$item->name}}</option>
                  @else
                    <option value="{{$item->area_code}}">{{$item->name}}</option>
                  @endif
                @endforeach
              </select>
            </div>
          </li>
          <li><span><i>*&nbsp;</i>小区名</span>
            <div class="cus-input-back cus-input-backcir">
              <input type="text" id="yezhu_residential_name" name="yezhu_residential_name" class="cus-input-cell"/>
              <ul id="ul-input-back"></ul>
            </div>
          </li>
          <li><span>来源</span>
            <div class="cus-input-back">
              <select id="yezhu_source" name="yezhu_source" class="cus-input-are">
                @foreach ($yezhuFormItems as $key => $val)
                  @if($yezuSource == $key)
                    <option value="{{$key}}" selected="selected">{{$val}}</option>
                  @else
                    <option value="{{$key}}">{{$val}}</option>
                  @endif
                @endforeach
              </select>
            </div>
          </li>
          <li><span>楼栋</span>
            <div class="cus-input-back">
              <input type="text" id="yezhu_building_name" name="yezhu_building_name"/>
            </div>
          </li>
          <li><span>单元</span>
            <div class="cus-input-back">
              <input type="text" id="yezhu_unit" name="yezhu_unit"/>
            </div>
          </li>
          <li><span>房号</span>
            <div class="cus-input-back">
              <input type="text" id="yezhu_house_no" name="yezhu_house_no"/>
            </div>
          </li>
          <li><span>期望租金</span>
            <div class="cus-input-back">
              <input type="text" id="yezhu_rental_price" name="yezhu_rental_price"/>
            </div>
          </li>
          <li style="color:#cd0a0a" class="msg"></li>
          <li><a id="yezhu-submit" class="cus-index-sub">提交</a><a href="javascript:;" id="yezhu-reset">重置</a></li>
          <li>
            <input type="hidden" name="_token" value="{{ csrf_token() }}"/>
            <input type="hidden" name="yezhu_uid" value="{{$qiyuUid}}"/>
            <input type="hidden" name="yezhu_area_code" value=""/>
            <input type="hidden" name="yezhu_business_circle_id" value=""/>
            <input type="hidden" name="yezhu_residential_id" value=""/>
          </li>
        </ul>
      </form>
    </div>
  </div>
  <div id="toast" class="alert-sure"></div>
@endsection
@section('footer')
@endsection
@push('scripts')
  <script>
    var customerConfig = {
        zuke_source: '@if(!empty($customer->data_source)){{$customer->data_source}}@else{{$zukeSource}}@endif',
        yezhu_source: '{{$yezuSource}}',
        city_code: "@if(!empty($customer->city_code)){{$customer->city_code}}@else{{$customCityCode}}@endif",
        area_code: "{{$customer->rent_area_code}}",
        business_circle_ids: "{{$customer->rent_business_circle_ids}}"
    };
  </script>
  <script src="{{web_static('pc/v3/js/customer-service.min.js',true)}}"></script>
  <script src="{{web_static('pc/v3/kit/jquery.mloading/jquery.mloading.js',true)}}"></script>
@endpush